from dotenv import load_dotenv, find_dotenv
from openai import OpenAI
load_dotenv(find_dotenv())

llm = OpenAI()
stream = llm.chat.completions.create(
    model="deepseek-ai/DeepSeek-V3",
    messages=[{"role": "user", "content": "用200字描述AI的未来"}],
    stream=True
)

for chunk in stream:
    content = chunk.choices[0].delta.content
    if content:
        print(content, end="", flush=True)